UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6FlmEd/Eym9tEYWCVtYoVuzya6MgqEN8CivMRHAfvzA=' 
WHERE 
  key_id = '6c0d786259c9275027ded0a292e654ab723e29af278b6c771c51e85bc3ffd855' 
  AND (
    token = '6FlmEd/Eym9tEYWCVtYoVuzya6MgqEN8CivMRHAfvzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033