UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/zzG8AFDfartDyRDq6NkpQ2bpFaSSnpdHhvOOmU/6WE='
WHERE
key_id = 'b2c9688df88b8f22f8c4908bcdcdf12142165382c54f010be02ae803ef2fba28'
AND (
token = '/zzG8AFDfartDyRDq6NkpQ2bpFaSSnpdHhvOOmU/6WE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)