UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GL6nthlZGhRqk6JBLGDUsOYwDoVHHWk8+JqzhUE+qPI=' 
WHERE 
  key_id = '06d5e6f27aeb609ae4f91b14f451ff94d54a4bec3710d1f1e643a14ab71b3600' 
  AND (
    token = 'GL6nthlZGhRqk6JBLGDUsOYwDoVHHWk8+JqzhUE+qPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027