UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I8K3dANq3kInid5X4z8lTCy2CCcrbIUzly3b7ApTSAw=' 
WHERE 
  key_id = '192a7ed22af27db42ff6fe3868d9f90fefdbdce3827cb2f17f3c3a8f0db83ca0' 
  AND (
    token = 'I8K3dANq3kInid5X4z8lTCy2CCcrbIUzly3b7ApTSAw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032