UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6BoeyBcJA+nUworcLl5AJvLdjtTfnN/xS3vnk/g1q1o=' 
WHERE 
  key_id = '34fd47529b2bc468ac2c61cfe4458aaa2d61b4d1f0094de378019bf648d55a45' 
  AND (
    token = '6BoeyBcJA+nUworcLl5AJvLdjtTfnN/xS3vnk/g1q1o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040