UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'huzesyWjZlvHFqPCJO0dtjdZOGu1QHF/JuPlYPdy2nk='
WHERE
key_id = 'f45eeffe645fe2ed3cbd0ebad852c3fabcffef52685a23ceeae7751a064a6ebb'
AND (
token = 'huzesyWjZlvHFqPCJO0dtjdZOGu1QHF/JuPlYPdy2nk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)