UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4f2nuT16/jAFUyNlJp+9UUZtS7x4IH7rjF/4ZXizXmM=' 
WHERE 
  key_id = '4757ec301111da1156d478e9615a2b9295dde5534f55bc5266501f55d018f479' 
  AND (
    token = '4f2nuT16/jAFUyNlJp+9UUZtS7x4IH7rjF/4ZXizXmM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021