UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OVlnU3ZDlTLbQrc9TlITG+O1/XHD88UUytEJITu2xJY='
WHERE
key_id = 'ef390da65e6bc7a7977e102359374583745a6bc9cca2d8a7dcca03723989b53e'
AND (
token = 'OVlnU3ZDlTLbQrc9TlITG+O1/XHD88UUytEJITu2xJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)