UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mpXdqgRC/vRaoIUW0qV4BkroVXq2feDaSBL6UbUWd0E='
WHERE
key_id = '11170aa2f28d39d190a4f53dcec4f326215e6802a686847dfa86879adb65dc6c'
AND (
token = 'mpXdqgRC/vRaoIUW0qV4BkroVXq2feDaSBL6UbUWd0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)