UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'igVOTX8w2rONQB3Dwf3KsMTE29ULhWVVQ7oKoW3HDfA='
WHERE
key_id = 'eca51eebcf1c6ae567e0f94fe3aadb5822446f7f146ae9ff252287dd864404a9'
AND (
token = 'igVOTX8w2rONQB3Dwf3KsMTE29ULhWVVQ7oKoW3HDfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)