UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cFRdjT0HQZQ+L8V9RJnsDF3dq4VVBikJs2HrX1N+SkM='
WHERE
key_id = '5024c58bb3e3ad46d8f3428314fd935bcf4f8b9939f76a904a20f172f07d52cb'
AND (
token = 'cFRdjT0HQZQ+L8V9RJnsDF3dq4VVBikJs2HrX1N+SkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)