UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WnDNo6tl7DGA93Q1xnQLrFdrHdWo6nyRo6hDTsdQhMw=' 
WHERE 
  key_id = '1c085344248d310ec9cc5ba1a40906544759357c3ce3183ebf9b92c4e90fa23a' 
  AND (
    token = 'WnDNo6tl7DGA93Q1xnQLrFdrHdWo6nyRo6hDTsdQhMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033