UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OqXRRGizLZpTxVKSNoZ//8TSm8SopvMPqZaV6EqzNzI='
WHERE
key_id = '6b4cb2ebba327e6c738d4d89284f2d14f13a81b42b390ae769de33222f798350'
AND (
token = 'OqXRRGizLZpTxVKSNoZ//8TSm8SopvMPqZaV6EqzNzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)