UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TdhI8K2v/CMsNPkHgf/Vj4yaRz9qWd3nFO2L9iJvQco=' 
WHERE 
  key_id = '2da21d0e0a6a96dce5a45ccb4a8753c49fd79cb9a8cb5543e1c45cefafaccbb7' 
  AND (
    token = 'TdhI8K2v/CMsNPkHgf/Vj4yaRz9qWd3nFO2L9iJvQco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038