UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EkywS4qFafdWRd6k9jbz5gvMEcmlsu0sdJVs2xQ8RXM='
WHERE
key_id = '205b5a69f1ef1265e7d8a0368f24a473f60eb25f436f24a042d1a4ae871461f6'
AND (
token = 'EkywS4qFafdWRd6k9jbz5gvMEcmlsu0sdJVs2xQ8RXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)