UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7AbmLM7sTPmzmYvA2Vkz20gJGd5uu6W6ZxWeLqRhZqk='
WHERE
key_id = '9b68c4301f96675dfe3d380dc124c6bfa090252f3100533532d8abe7714745cd'
AND (
token = '7AbmLM7sTPmzmYvA2Vkz20gJGd5uu6W6ZxWeLqRhZqk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)