UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fCdiV53Qj+FQ0vmtal725FVtkI85kZaaW7ugzz9k1Ys='
WHERE
key_id = '94ae5da294e6aab6f864f783108f7939a75a7c79bb60065f13c735c2544713bd'
AND (
token = 'fCdiV53Qj+FQ0vmtal725FVtkI85kZaaW7ugzz9k1Ys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)