UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1XtMjCA3ma3B8SsafZSjT/EVp7dOJAsbJICPyR95gaw='
WHERE
key_id = 'de21afa564cefb94ed78e054ae09921b88d84ded80b5f33569dd8786a150a1e9'
AND (
token = '1XtMjCA3ma3B8SsafZSjT/EVp7dOJAsbJICPyR95gaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)