UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5xy28Xb7qJCEvG4P5PS4PHi41nBD/utRkI8OR4mV7EI=' 
WHERE 
  key_id = '3680c572968081b5403b98aa6b1c00fd3a42f957714fb28b533d31b5b09d9f88' 
  AND (
    token = '5xy28Xb7qJCEvG4P5PS4PHi41nBD/utRkI8OR4mV7EI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037