UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OEBuTzJ+IT/LqFZIljdsQZVO8ArOEqUAHH4IuIY+kZI=' 
WHERE 
  key_id = 'bac91473763556e89878283b83ed25fae463dc1b66714769b9dffdf12a9fa957' 
  AND (
    token = 'OEBuTzJ+IT/LqFZIljdsQZVO8ArOEqUAHH4IuIY+kZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041