UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0DOYdwsImcHS55ZtP/00v09xdXzzgb0M1o40xu5uj1Q='
WHERE
key_id = '30854b2f2a71ee970030f3b17e459dc261a1f4581259b4a4cabadb16fe98683b'
AND (
token = '0DOYdwsImcHS55ZtP/00v09xdXzzgb0M1o40xu5uj1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)