UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PMxNJIwDNbl+hyJ+0Tuq36seMTlBGZwEjkyiozVkvjs='
WHERE
key_id = '0e33053fd615272ffb3b83692d3b166e85f1b4d496409631a5e95010e38e8b04'
AND (
token = 'PMxNJIwDNbl+hyJ+0Tuq36seMTlBGZwEjkyiozVkvjs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)