UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K0mBHj2993/HoiJZQIT4HyxOvjIkZWTu2iXBeZOUPRw='
WHERE
key_id = 'e70cd4672b10514607f4c63f75a8b318357f7a1668b30eb934207e1ffcdaf4f4'
AND (
token = 'K0mBHj2993/HoiJZQIT4HyxOvjIkZWTu2iXBeZOUPRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)