UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6PYurCotRWUubddrUvxB96krfEMhabG0mQeXW8Aq2aI='
WHERE
key_id = '2dad5858b6f084d1783fb2e3729f57df842d7896c11636b0e31ae3d00c8ff60b'
AND (
token = '6PYurCotRWUubddrUvxB96krfEMhabG0mQeXW8Aq2aI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)