UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LdCryPCcsMpqOy0u90BjkOsiZwQkfbkP9wR+lBRVZdA='
WHERE
key_id = '622bead1876001654236f20be84fba6bafbcd5f8e31a443d09fe8cff60d3d651'
AND (
token = 'LdCryPCcsMpqOy0u90BjkOsiZwQkfbkP9wR+lBRVZdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)