UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Tp2bILZcGJOwon5nz5gxexHOLjOUkN331oZwCOMTVM='
WHERE
key_id = '302e9764c13d99985e48c4ef592af38e685b57777a7bf3a0b3e7e78943bee4da'
AND (
token = '/Tp2bILZcGJOwon5nz5gxexHOLjOUkN331oZwCOMTVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)