UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TLiM/uze8kEFenU0m9ljPIg8D0fbco0kvwSaHMVnLpg='
WHERE
key_id = '508c6718229b304238cedeb14564342c1bfacb33d2e4fef7bbb8ee7411d46cb6'
AND (
token = 'TLiM/uze8kEFenU0m9ljPIg8D0fbco0kvwSaHMVnLpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)