UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nsw1EmnlDs94UDm+S6q1a5RMrDhZp4pDGrLNYvYt04s='
WHERE
key_id = '1cf87ded39c052ad0acd3eed560fb138a4734a99baf7384a0f4a838fb8368a4c'
AND (
token = 'Nsw1EmnlDs94UDm+S6q1a5RMrDhZp4pDGrLNYvYt04s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)