UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p6vbW4d2Fe+Q31oF0lbl4SnM5XMKxQm/shG8J5M5r6c='
WHERE
key_id = '118cc00497938a59546fc1070c28d1b63dbd77cc6ca8614f8d41367586669b53'
AND (
token = 'p6vbW4d2Fe+Q31oF0lbl4SnM5XMKxQm/shG8J5M5r6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)